<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAdminRoleTable extends Migration
{

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		// 用户的角色。
		Schema::create('admin_role', function (Blueprint $table)
		{
			$table->engine = 'InnoDB';

			$table->increments('id');

			// 用户
			$table->unsignedInteger('admin_id')->index()->comment('用户');

			// 角色
			$table->unsignedInteger('role_id')->index()->comment('角色');

			$table->timestamps();
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('admin_role');
	}
}
